package com.wanye.validator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Created by wanye on 2017/9/18.
 */
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy = {PhoneConstraint.class})
public @interface Phone {
    String message() default "手机号格式错误";
    String regexp() default "^((13[0-9])|(15[^4,\\D])|(18[0,3-9]))\\d{8}$";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default { };

}
